Repository navigation
[PR] feat(dsh): route models between stock native and bili compaction - #6123
bluesmilery wants to merge 19 commits into
Conversation
[bot] (ai: vllm-qwen/qwen3.8-27b) Full independent review of this draft PR (GitHub #6123) is done — code, tests, docs, CI and compatibility boundaries walked from the diff, not from the PR description. Verdict up front: code quality is high; what's outstanding is your sign-off on the configuration contract plus a short punch-list before undrafting. No forced alignment-refactor warranted — naming, structure, error handling and test style match repo conventions. 查重: 不重复。 Searched open+closed issues/PRs for a per-model native-compaction mechanism — no prior thread proposes it. Same family as #5994 (restore native when bili-native is absent/disabled) but different granularity and mechanism: #5994 is binary/global (the whole lane flips to native when bili is off); this PR is per-model ownership declared in config, with bili still active for every other model and safe mid-session switching. Different enough to stand alone. 标签: Live state (verified just now): head What I verified independently
Findings (punch-list — none blocking by itself)
Behavior-change disclosure (old → new)
🔶 需要决策背景一句话:本 PR 是 DRAFT,作者明确请求 maintainer 审「配置/归属契约」;按 Configuration Surface Discipline,新增配置字段必须 owner 签核后才能进入合并。待决问题:是否批准 结构化八问:
选项对比:
推荐 A:形状贴合既有 不决定的默认行为:PR 保持 draft,不合并、不再推进,等待你的拍板。 收工判定:代码质量高、CI 绿、方向不跑偏——可进入契约审批;契约批准后补齐小修清单 + rebase 即可撤 draft 待合。本 bot 不关闭、不合并该 issue/PR(owner 权限)。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Status note after two daemon restarts mid-task (the work finished before the last one fired — nothing lost):
I will not close or merge anything (owner-only). Waiting on your call. |
[bot] (ai: vllm-qwen/qwen3.8-27b) 进度汇报(进程被强制重启后恢复): 我是本 PR 的 CI 工程师(11-12 两次系统指派「上游 PR 冲突(dirty),冲突与红项由 CI 工程师一次处理」)。上次会话在同步 master 阶段卡住被重启,无阶段性成果丢失——工作树干净,恢复后已重新核实全部状态: 当前实况(刚刚核实):
接下来(本次会话继续执行):
预计 30–60 分钟内给出冲突解决结果。若中途再遇阻塞会立即汇报,不会静默卡住。 |
# Conflicts: # scripts/live-files.mjs
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) PR #6123 冲突 + 红项处理进度(进程重启后接续) 1. 冲突已解决并推送。 把 2. 本地验证(§7.2:全量回归交给 CI): 3. 红项 = PR 自带测试的确定性缺陷,根因已钉死,正在修。 失败测试 "bili-only and model-routed bili have identical real proxy folds and forwarded requests"(本 PR 新增)fork 两个独立 proxy 逐字节对比转发请求,但 proxy 盖的 ACP 标签带墙钟 4. CI:新 head 已推送在跑,走镜像缓存查看(不轮询),flake 修复 + CI 结果出来后给最终八问。 八问(当前状态)
判定:冲突解决完成、已推送;红项根因已钉死、修复进行中;CI 绿后给最终结论。 |
The parity test compares forwarded payloads across three forked proxy arms with deepEqual, but the kernel stamps wall-clock yyyy-mm-dd hh:mm:ss timestamps into the ACP tag time= attribute and the compress tool-result block time range. Arms running on different seconds differ in those bytes alone, so the comparison flaked. Mask every wall-clock timestamp before the cross-arm comparison (same sanctioned normalization as issue5403-watermark-fastpath.test.ts).
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Independent review of PR #6126 (GitHub #6123) — complete. I completed a full independent end-to-end review of the PR (head 08bf768, 27 files, +959/-27). Verdict: 🔶 需要决策 — config contract pending owner sign-offThe code is clean (no blocking findings). However, this is a DRAFT feature PR that introduces a new config field I do NOT approve — not because the code is deficient, but because the config contract requires owner sign-off. The PR body itself states: "This PR is draft for maintainer review of the configuration/ownership contract. No maintainer approval, merge or release is implied." What I verified
Findings (all non-blocking, already in floor 5 punch-list)
None blocking. All are disclosure/doc/test-coverage items already noted in floor 5. 8问 (structured review checklist)
收工判定代码质量高,测试有牙,文档/配置/构建表面一致,默认零变更。但这是 DRAFT 功能 PR + 新配置字段,需要 owner 签核配置契约。不批准——路由到 🔶 需要决策。needs-decision 标签已由 floor 5 打好。 注: |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI-engineer run complete: conflict resolved + red item fixed, both pushed, CI green on the new head. What I did this run
结构化八问
判定:冲突已解、红项已修、CI 绿,PR 分支 head = |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Independent review — code is clean, but this is a DRAFT feature PR with a new config field requiring owner sign-off.
I completed a full independent end-to-end review of the PR (head 08bf768, 27 files, +959/-27).
Verdict: 🔶 需要决策 — config contract pending owner sign-off
The code is clean (no blocking findings). However, this is a DRAFT feature PR that introduces a new config field dsh.nativeCompactionModels. Per Configuration Surface Discipline (owner-gated), a new config field requires owner sign-off BEFORE implementation. I confirm the needs-decision routing from the prior review with my own independent analysis.
I do NOT approve — not because the code is deficient, but because the config contract requires owner sign-off. The PR body itself states: "This PR is draft for maintainer review of the configuration/ownership contract. No maintainer approval, merge or release is implied."
What I verified
- kernel/ and pi-subagents/ UNTOUCHED — zero files under
kernel/orpi-subagents/in the diff. Nokernel-changedeclaration. The HARD RULE (kernel gate) does NOT apply. - Default
[]= zero change — with no config, the wire is byte-identical to today. Opt-in only. - Tests have teeth — 7 both-directions unit tests, e2e A/B (native/bili/native switch + bili-only vs routed-bili parity via forked proxies), real-DSH integration script, WS socket direct + refuse-reuse, native-intercept bypass bytes/headers.
- Docs/config/build surfaces consistent — en/zh docs, configuration.md, architecture.md, index.md, README.zh-CN.md, reference/architecture.md, website/config-reference/server.yaml, package.json exports, tsup.config.ts, check-unused-exports.mjs, live-files.mjs — all updated in the same PR.
- CI green per dispatch.
Findings (all non-blocking, already in prior review punch-list)
- Title-request zombie ledger (iso + gen≥1): title requests use raw
sidwhile main traffic is scoped → phantom conversation accumulates; untested. - Fail-closed blast radius (iso + DSH build lacking
session.surface.replaceGeneration): every conversation-id call throws → even bili models lose bili tools; should be disclosed in PR Behavior section. - Malformed-config edge: invalid entry throws at lane activation; preset keeps stock compaction-basic armed without bili tools; one doc sentence needed.
- Missing test rows (4): client React probe path,
/bili/origin?sessionId=policy face, title-request behavior, ready-set miss with valid id. - Nits:
noteGateCoverageskipped on noBackend branch; WS owner check on create-frames only (deemed fine);attachEngine~90L could split.
None blocking. All are disclosure/doc/test-coverage items already noted in the prior review.
收工判定
代码质量高,测试有牙,文档/配置/构建表面一致,默认零变更。但这是 DRAFT 功能 PR + 新配置字段,需要 owner 签核配置契约。不批准——路由到 🔶 需要决策。
Resolves the two doc/config conflicts from master's Japanese-docs + config-coverage work: - docs/architecture.md: union (keep PR's DSH native-model-policy intro line + master's en/zh/ja hub line). - website/config-reference/server.yaml: keep the PR's feature-aware dsh section desc (wire guard refuses UNMANAGED native compaction, nativeCompactionModels bypasses it) over master's stale 'refused unconditionally' wording; add the desc_ja that master's new gen-config-docs check-coverage now requires on every entry for dsh.nativeCompactionModels / .model / .provider. No code changes; config-coverage and architecture-docs guards green.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) PR #6123 冲突再次处理完成(master 在 11-12 之后又前进了 140 提交,触发新一轮 dirty 派发)。 状态核实(推送后单次 GET 确认,非轮询):
这次做了什么
结构化八问
判定:冲突已解、会红 CI 的 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review at new head d98db52 — verdict unchanged: 🔶 需要决策 The new head is a pure master sync (merge commit Verdict stands: code clean, no blocking findings, but the new config field |
Resolves the one code conflict in src/agent/dsh-native.ts (master moved 265 commits past the previous merge base 36a04a7): - PluginContext.tools type: union of the PR's register {when} conditional (native-compaction model gating) and master's new tools.get? method. - restoreTools register call: keep master's host-owned-lifetime structure (owner.ctx.tools.register(definition), ranxianglei#6702/ranxianglei#3380) and re-attach the PR's {when} predicate so bili tools stay hidden on native-owned models. definition is the same toolDefinition(tool) master pre-builds into owner.definitions (line 1084), so behavior is identical to the PR's inline registration. Verified locally: typecheck + build green; dsh-native-compaction + dsh-native targeted suites 83/83 pass.
…l-native-compaction # Conflicts: # src/agent/dsh-compaction-disable.ts
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review at head 15efcee — verdict unchanged: 🔶 需要决策 Pure master sync (merge No new findings. Awaiting owner decision on the |
|
(ai: vllm-qwen/qwen3.8-27b) Re-review at head 15efcee — pure master sync, PR code identical to prior head. Verdict unchanged: 🔶 需要决策 (config contract pending owner sign-off). No new findings. |
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved — the PR is now What I did this run:
八问:
收工判定:冲突已解、CI 全绿,PR 处于可合并状态;当前 mergeable_state=blocked 仅剩人工 review 审批(本 PR 为 feat 类,按 §7.4 属 human-only 档),等 reviewer/owner 批准,合并动作由人执行。 |
…l-native-compaction # Conflicts: # reference/architecture.md # src/agent/dsh-native.ts
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review at head d313e83 — verdict unchanged: 🔶 需要决策 Pure master sync (merge No new findings. Awaiting owner decision on the |
|
(ai: vllm-qwen/qwen3.8-27b) Re-review at head d313e83 — pure master sync, PR code identical to prior head. Verdict unchanged: 🔶 需要决策 (config contract pending owner sign-off). No new findings. |
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved — the PR is now What I did this run:
八问:
收工判定:冲突已解、CI 全绿,PR 处于可合并状态;当前 mergeable_state=blocked 源于 PR 仍是 draft 且为 feat 类(按 §7.4 属 human-only 档),等作者/owner 转 ready 并批准,合并动作由人执行。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Status — re-review round closed, state re-verified just now. The dispatch this run was a self-forward: the message forwarded to me (upstream comment 7101733633) was my own re-review comment posted at 12:51Z (floor 97), mirroring back — no new upstream input, so no rework was needed. I re-verified the live state instead of re-doing the review: Live state (verified 2026-11-23 ~20:55 UTC):
What remains (unchanged since floor 5, all pre-undraft punch-list, none blocking the contract decision):
Risk if left undecided: none accumulates — PR stays draft, zero user impact until merged; the branch is already synced to master and green. 结构化八问(本轮)
收工判定:本轮无新发现、无新动作——PR 绿、可合并(仅 draft 状态阻塞),等待你对配置契约拍板;拍板后作者补小修清单 + 撤 draft 即可。本 bot 不撤 draft、不合并、不关闭(owner 权限)。 |
# Conflicts: # src/agent/dsh-compaction-disable.ts
(ai: vllm-qwen/qwen3.8-27b) PR #6123 冲突再次处理完成(master 自上次同步 本次做了什么
结构化八问
判定:冲突已解、本地验证全绿、已推送 |
(ai: vllm-qwen/qwen3.8-27b) 本次为陈旧派发(stale dispatch)——冲突已在上一轮解决,本轮无动作。 live 状态(刚刚核实,非凭记忆):
为什么收到这条 dirty 派发:镜像 poller 是在旧 head 本轮处置:不重做、不重复 rebase、不抢分支(push discipline)——冲突已解、已推、CI 正在新 head 八问(本轮)
判定:无新动作,PR 已不 dirty,等 CI 在新 head 上跑绿 + owner 决定 un-draft / 合并。本 bot 不撤 draft、不合并、不关闭(owner 权限)。 |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-delta review at head d48bd5d (d313e83 + master 85afa7b, 153 commits) The PR's own diff is byte-identical to the previously reviewed head (28 files, +967/-29). This review covers the master sync only. Conflict resolution —
The combination is not a mere union: without master's fix, 8 auto-merged files — clean union, no semantic interaction. CI: 30/30 checks green on d48bd5d. Verdict: no new findings. The PR remains a DRAFT feature PR adding the owner-gated |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review at new head d48bd5d (master sync) — no new findings; verdict unchanged: 🔶 需要决策 The CI engineer's master sync (floor 106) produced head d48bd5d (2 parents: d313e83 + master 85afa7b, 153 commits). I independently verified the merge delta:
One correction to floor 106: the Still pending (unchanged from floor 103):
结构化八问
收工判定: 合并增量验证通过,无新发现;PR 保持 draft,结论维持 🔶 需要决策——等 owner 对 config 契约拍板后,作者补齐 pre-undraft 清单再 undraft。 协调一行: PR #6123 状态 = 绿(30/30 CI, head d48bd5d, mergeable, 仅 draft 阻塞),合并增量审查通过,无新发现,等待 owner 决策。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) The forwarded comment is my own merge-delta review (posted to PR #6123 as comment 7147575448, mirrored here at floor 111) — no new input in it. State is unchanged since my full reply at floor 112:
No action needed until the owner decides; the pre-undraft punch list (title-request scoping + test, 4 test rows, 2 doc sentences) stays as pre-undraft items inside that pending decision. |
# Conflicts: # reference/architecture.md # tsup.config.ts
(ai: vllm-qwen/qwen3.8-27b) PR #6123 冲突再次处理完成(master 自上次同步 本次做了什么
运维备注:本共享工作区的 结构化八问
判定:冲突已解、本地验证全绿、已推送 |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-delta review at head 1aae293 (d48bd5d + master c4eab2e, 306 commits) The PR's own diff is semantically unchanged from the previously reviewed head (28 files, +967/-29; content lines byte-identical — the only textual delta is the 14 both-side files — all verified clean unions.
CI: 30/30 checks green on 1aae293. Verdict: no new findings. The PR remains a DRAFT feature PR adding the owner-gated |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review at new head 1aae293 (second master sync) — no new findings; verdict unchanged: 🔶 需要决策 The CI engineer's sync (floor 116) produced head 1aae293 (2 parents: d48bd5d + master c4eab2e, 306 commits). I independently verified the merge delta:
One note on floor 116: Still pending (unchanged):
结构化八问
收工判定: 第二次合并增量验证通过,无新发现;PR 保持 draft,结论维持 🔶 需要决策——等 owner 对 config 契约拍板后,作者补齐 pre-undraft 清单再 undraft。 协调一行: PR #6123 状态 = 绿(30/30 CI, head 1aae293, mergeable, 仅 draft 阻塞),第二次合并增量审查通过,无新发现,等待 owner 决策。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) This is a self-forward of my own PR comment (#6123 (comment)) — the merge-delta review at head 1aae293, already summarized in my reply above (3450 chars, 八问 included). No new input since then: state unchanged, verdict stays 🔶 需要决策 — awaiting owner sign-off on the |
|
Updated this branch in fb4e82c for the runtime preset registry introduced since the original proposal. The registration hook previously disabled the stock compactor even after the selective load-time rewrite. Both paths now preserve the stock backend in its own group and remain idempotent; presets without an enabled backend keep their stock no-backend behavior. Declared auxiliary calls no longer need a live main-session generation. The guide documents refusal scope and invalid configuration. Validated the release port on v0.1.218: 174 focused route/transport tests and 16 side-by-side cases using the actual DSH 0.2.2-rc.5 runtime (including GPT/Claude paths, switches, repeated pressure, oversized input and provider failures). No change to native summary prompts, budgets or algorithms. The prerequisite config remains opt-in; leaving the PR as a draft for the owner's configuration-surface decision. The dependent fold-reuse change has its own PR: #8123. It is not included in this branch. |
|
(ai: vllm-qwen/qwen3.8-27b) Review of new commit fb4e82c (on top of the verified 1aae293 merge) This commit fixes a real bug and addresses part of the review punch list. Verified line-by-line: 1. Runtime registration bug fix — confirmed real and correct. 2. 3. 4. Doc claims verified against code. "A malformed rule in an otherwise readable config prevents the DSH plugin from activating" — true: 5. Release-port script — six model patterns (GPT/Claude paths), three new scenarios (claude-pressure, switch-bili-to-claude, switch-gpt-to-claude), and Punch-list status after this commit (from the original review, mirror issue #6126 floor 5):
CI: running on fb4e82c (0 failed so far, 9 checks still pending at review time). Verdict: no new findings; the commit is a net improvement. The PR remains a DRAFT feature PR adding the owner-gated |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review at new head fb4e82c (author's new commit on top of the verified 1aae293 merge) — no new findings; the commit fixes a real bug and closes part of the punch list. Verdict unchanged: 🔶 需要决策 The author pushed fb4e82c ("Keep selective compaction intact for runtime presets and scoped auxiliary calls"). I verified it line-by-line:
Punch-list status (origin: floor 5):
结构化八问
收工判定: 新提交验证通过、无新发现,小修清单推进了 2 项(坏配置文档句、title 行为决策+测试);剩余:PR 正文 blast-radius 句、3 条测试行、辅助存储噪声文档句、noteGateCoverage 小疵。PR 保持 draft,结论维持 🔶 需要决策——等 owner 对 config 契约拍板后补齐剩余清单再 undraft。 协调一行: PR #6123 状态 = 作者新提交 fb4e82c 已审(修复真实 bug + 泛化辅助豁免,无新发现),CI 运行中(0 失败),等待 owner 决策。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Self-forward of my own PR comment (#6123 (comment)) — the fb4e82c review, already summarized in my reply above (4281 chars, 八问 included). No new input since then: state unchanged, verdict stays 🔶 需要决策 — awaiting owner sign-off on the |
# Conflicts: # tsup.config.ts
(ai: vllm-qwen/qwen3.8-27b) PR #6123 冲突再次处理完成(本轮是「双方都在动」的新一轮:作者在我上次的合并之上推了新提交,master 又前进了 28 提交)。 本次做了什么
结构化八问
判定:冲突已解、本地验证全绿、已推送 |
DSH Web users can select models that use stock DSH compaction while unmatched models continue to use bili. For example,
gpt-*/codex/gpt-*use native compaction and GLM/Kimi use bili, including switching within one session. Wire passthrough alone cannot restore the disabled host backend.Refs #6121; related #6106, #5975, #5300/#5404 and #4872/#4883.
Configuration surface proposal
Adds opt-in
dsh.nativeCompactionModels: Array<{ provider?: string, model: string }>. Provider IDs match exactly; model IDs match exactly or by a trailing prefix*. No setting retains the existing bili behavior. Restart the host after changing the preset policy. An explicitly empty list returns all models to bili while retaining the generation isolation established by earlier native checkpoints; deleting the setting is a separate migration.This remains a draft for maintainer review of the configuration and ownership contract. No maintainer approval, release or merge is implied.
Behavior
summarizeexactly once with the same input, agent, signal and receiver. Return its result/error unchanged. DSH owns thresholds, retention, model selection, prompts, output limits, pressure retries and checkpoint transactions.surface.replaceGenerationas the bili namespace boundary. Native checkpoints invalidate old fold identity without mutating the original event log. Replaying a session preserves this namespace. Ordinary appends and switches without a host replacement keep it stable.There is no additional summary budget check, tool-schema reservation, message splitting, intermediate summarization, recursive merge or merge prompt. Those additions from earlier revisions of this draft have been removed. An oversized native request has stock DSH/provider failure behavior; this routing feature does not promise successful handoff of arbitrarily long history. The earlier Luna merge-quality A/B measured the removed implementation and is not acceptance evidence for this revision.
Validation
0.2.2-rc.1engine differential integration: 13 cases compare an engine without the policy adapter against one with it. Both start from exactly equal events. Compare complete summary requests, compaction events, replacement generations and measured context; normalize only newly generated host IDs. Cases cover below-pressure, pressure, two consecutive native compactions, manual/region compaction, model switching, explicit summarization model, provider error, retry, cancellation, oversized history and large/oversized tool catalogs. Error cases preserve history in both arms.compresstool, resend its real call/result, and verify the retained summary and shorter request. Ignore only fold timestamps, durations and generated invocation IDs. Assert routing rules are active after plugin initialization.c4a91e9c4d882b8dcd4c5530436e39740509f304: 38 successful, 14 conditionally skipped, none failed or pending. Skipped checks are not claimed as executed coverage.The differential upstream is deterministic to eliminate model randomness. These tests establish routing/algorithm-call parity for the covered cases, not universal summary fidelity.
Subsequent live deployment validation
The same head was backed up and installed through the official DSH plugin installer on the target Mac mini; all 21 installed dist files match the verified candidate. Two new real sessions exercised Luna native automatic/manual compaction, GLM bili compression, and both round trips. Eight successful native summaries and one bili block retain five fixed facts each; six recall checks pass. Thirty-nine raw-history prefix comparisons are unchanged. In the native handoff, DSH selected the previous GLM model for summaries; the old bili request counter remained 17 → 17, confirming the auxiliary calls bypassed bili. Returning to bili used a fresh namespace without old folds. Existing sessions remain listed, compression configuration is unchanged, and the prior default model was restored.
This was not an entirely clean run. The longer GLM → Luna switch failed twice at the stock shrink guard (summary 688 >= 432 and 431 >= 429 estimated tokens); completed checkpoints survived and the previous request header was preserved. Stock /compact then reduced the retained history and enabled the switch and return. One ordinary Luna pressure-compaction attempt also failed the stock shrink guard but its turn continued successfully. One GLM upstream stream_error recovered on short requests, and one GLM answer invoked read-only acp_status despite a no-tools prompt. These outcomes remain documented, with no adapter budget, splitting, prompt or retry changes. Bili compaction was explicitly requested; the 200000-token automatic nudge threshold was not exercised.
Compatibility and patch maintenance
Web standard/ptc/cordis and structurally equivalent presets with
dsh-compaction-basicare covered. Stock minimal remains without a compaction backend; unsupported/unattached policies fail explicitly. Unknown DSH API versions and root-plane CLI compositions require additional compatibility validation.The bilingual guide and detached-runtime integration script ship with the source. The local patch kit pins the upstream base, source commit, cumulative patch hash and DSH module hashes. Updates reapply to a clean checkout and rerun tests/build/integration before creating a candidate. Conflicts or failed checks retain the installed version; unknown future versions are not assumed compatible.
No kernel or proxy compression-pipeline changes, package version bump, registry publish or merge. The verified local package has been deployed after backup; the PR remains a draft.